#include "CQInterface.h"

namespace CQLIB {
	namespace CQNET {
		Server_Ptr CQNetwork::getServer_Tcp(int port, const std::string& ip, void* cb, void* ptr)
		{
			return Server_Ptr(new CQAcceptor_TCP(ip, port, cb, ptr));
		}

		Server_Ptr CQNetwork::getServer_Tcp(int port, void* cb, void* ptr, const std::string& ip) const
		{
			return getServer_Tcp(port, ip, cb, ptr);
		}

		Client_Ptr CQNetwork::getClient_Tcp(int port, const std::string& ip, void* cb, void* ptr)
		{
			return Client_Ptr(new CQConnector_TCP(ip, port, cb, ptr));
		}

		Client_Ptr CQNetwork::getClient_Tcp(int port, void* cb, void* ptr, const std::string& ip) const
		{
			return getClient_Tcp(port, ip, cb, ptr);
		}

		Server_Ptr CQNetwork::getServer_Tcp(int port, io_service& io, const std::string& ip, void* cb, void* ptr)
		{
			return Server_Ptr(new CQAcceptor_TCP(ip, port, cb, ptr, io));
		}

		Client_Ptr CQNetwork::getClient_Tcp(int port, io_service& io, const std::string& ip, void* cb, void* ptr)
		{
			return Client_Ptr(new CQConnector_TCP(ip, port, cb, ptr, io));
		}

		LIBCQNET_API CQNETWORK CQNet() { return CQNETWORK(new CQNetwork()); }
	}
}
